    <%@ include file="/common/taglibs.jsp"%>

    <head>
        <title><fmt:message key="attachmentList.title"/></title>
        <meta name="menu" content="AttachmentListMenu"/>
    </head>

    <script type="text/javascript">var batchexportMessage ="<fmt:message key="sendAttachment.batch.message"/>";</script>
    <script type="text/javascript">var shipNumberMessage ="<fmt:message key="sendAttachment.shipNumber.message"/>";</script>

    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            <fmt:message key="attachmentList.heading"/>
            <small><p><fmt:message key="attachmentList.message"/></p></small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i><fmt:message key="attachmentList.heading"/></a></li>
            <li class="active"> <fmt:message key="attachmentList.heading"/></li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                    <%@ include file="/common/messages.jsp" %>
                <div class="box box-success box-solid">
    <div class="box-header">
        <h3 class="box-title"> <fmt:message key="materialList.heading"/></h3>
    </div><!-- /.box-header -->
    <div class="box-body">
        <form action="printMaterialsForm" method="get">
            <input type="hidden" name="maId" value="${param.maId}"/>
            <display:table name="materialAudit.materialList" class="table table-condensed table-striped table-hover" requestURI="" id="materialList" export="false" pagesize="100">
                <display:column titleKey="button.select" sortable="false" style="width: 3%;">
                    <c:choose>
                        <c:when test="${!materialList.received and materialList.sent}">
                            <input type="checkbox" name="selectedIds" value="<c:out value="${materialList.id}"/>" checked="checked"/>
                        </c:when>
                        <c:otherwise>
                            <input type="checkbox" name="receiveIds" value="<c:out value="${materialList.id}"/>" <c:if test="${materialList.received}">checked="checked"</c:if> disabled/>
                        </c:otherwise>
                    </c:choose>
                </display:column>
                <display:column property="id" media="csv excel xml pdf" titleKey="attachment.id"/>
                <display:column sortable="true" titleKey="attachment.name" style="width: 40%;"><fmt:message key="MATERIAL_${materialList.name}"/></display:column>
                <display:column titleKey="material.loanRequested" sortable="false" style="width: 20%;">
                    <c:choose>
                        <c:when test="${not materialList.loanRequest}">
                            <input type="checkbox" name="loanRequestedMaterials" value="<c:out value="${materialList.name}"/>" disabled/>
                        </c:when>
                        <c:otherwise>
                            <input type="checkbox" name="loanRequestedMaterials" value="<c:out value="${materialList.name}"/>" disabled checked="checked"/>
                        </c:otherwise>
                    </c:choose>
                </display:column>
                <display:column property="shipNumber" titleKey="material.shipNumber" style="width: 20%;"/>
            </display:table>

            <button type="submit" class="btn btn-primary" id="print" name="print">
                <i class="icon-ok icon-white"></i> <fmt:message key="button.material.print"/>
            </button>

            <button type="submit" class="btn btn-primary" id="reject" name="reject" formmethod="post">
                <i class="ui-icon-eject icon-white"></i> <fmt:message key="button.material.rollback"/>
            </button>
            <a class="btn btn-primary margin" href='/loanRequestform?reqId=${materialAudit.loanRequest.id}'><fmt:message key="button.back"></fmt:message></a>
        </form>
    </div><!-- /.box -->
    </div>



    </section><!-- /.content -->

    <c:set var="scripts" scope="request">
        <script type='text/javascript' src="<c:url value='/dwr/interface/UserManager.js'/>"></script>
        <script type='text/javascript' src="<c:url value='/dwr/engine.js'/>"></script>
        <script type='text/javascript' src="<c:url value='/dwr/util.js'/>"></script>

    </c:set>
